package Main;

import java.awt.BorderLayout;
import java.awt.Canvas;
import java.awt.Color;
import java.awt.Frame;
import java.awt.Graphics;
import java.awt.Toolkit;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
import java.awt.event.WindowListener;
import java.awt.image.BufferedImage;
import java.io.File;
import java.io.IOException;

import javax.imageio.ImageIO;
import javax.swing.JFileChooser;
import javax.swing.JFrame;
import javax.swing.filechooser.FileFilter;

public class Main extends Frame implements WindowListener
{
	Toolkit kit = Toolkit.getDefaultToolkit();
	leftBar leftbar;
	File picFile;
	static GUI gui;
	
	public static void main(String args[])
	{
		Main f = new Main();
	}
	
	public Main()
	{
		leftbar = new leftBar();
		gui = new GUI();
		/*gui.addOptionsPanel(leftbar);
		add(leftbar,BorderLayout.WEST);*/
	}
	
	public void getFile()
	{
		JFileChooser chooser = new JFileChooser();
		chooser.setFileSelectionMode(JFileChooser.FILES_ONLY);
		chooser.showOpenDialog(this);
		picFile = chooser.getSelectedFile();
		if(picFile != null)
		{
			try {
				BufferedImage image = ImageIO.read(picFile);
			} catch (IOException e) {
				System.out.println("File is not picture");
			}
			repaint();
		}
	}
	
	public void paint(Graphics gfx)
	{
		
	}

	@Override
	public void windowActivated(WindowEvent arg0) 
	{
		// TODO Auto-generated method stub
	}

	@Override
	public void windowClosed(WindowEvent e) 
	{
		dispose();
		System.exit(0);
	}

	@Override
	public void windowClosing(WindowEvent e) 
	{
		// TODO Auto-generated method stub
	}

	@Override
	public void windowDeactivated(WindowEvent e) 
	{
		// TODO Auto-generated method stub
		
	}

	@Override
	public void windowDeiconified(WindowEvent e) 
	{
		// TODO Auto-generated method stub
		
	}

	@Override
	public void windowIconified(WindowEvent e) 
	{
		// TODO Auto-generated method stub
		
	}

	@Override
	public void windowOpened(WindowEvent e) 
	{
		// TODO Auto-generated method stub
		
	}
	class ProgramTerminator extends WindowAdapter {
		public void windowClosing(WindowEvent e) {
			System.exit(0);
		}
	}
}
